@extends('layout.app')
@section('content')
    <ul class="nav nav-tabs">
        <li class="active"><a href="#home" data-toggle="tab">视频信息</a></li>
        {{--<li><a href="#profile" data-toggle="tab">培训介绍</a></li>--}}
    </ul>

    <div class="row">
        <div class="col-md-6">

            <br>
            @if(Session::has('message'))
                <li class="list-group-item list-group-item-success">{{Session::get('message')}}</li>
            @endif
            @if($errors->any())
                <ul class="list-group">
                    @foreach($errors->all() as $error)
                        <li class="list-group-item list-group-item-danger">{{$error}}</li>
                    @endforeach
                </ul>
            @endif
            <br>
            {!! Form::model($train,['method'=>'PATCH','id'=>'tab','files'=>true,'url'=>'admin/'.$modelurl.'/'.$train->id]) !!}
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane active in" id="home">
                    @foreach($formhead as $head)
                        @if($head[1]=='cover_image'||$head[1]=='soft_image' )
                            {!! Form::label('pic','当前图片:') !!}
                            <div class="panel-body">

                                <image style="height:auto ;width:80% ;  overflow:hidden; display:inline; margin:0;box-shadow:rgba(255,255,255,1) 0 0 0 2px, rgba(0,0,0,1) 0 0 2px 2px;" onerror="onerror=null;src='/image/null.png'" src="{{$train->cover_image}}"></image>


                            </div>
                            {!! Form::label($head[1],$head[0].':') !!}
                            {!! Form::file($head[1],['class'=>'form-control','id'=>'image']) !!}
                            @continue
                        @endif
                        @if($head[1]=='club' )

                            @continue
                        @endif
                        @if($head[1]=='mentor' )
                            <div class="form-group">
                                {{--,'multiple'=>'multiple'--}}
                                {!! Form::label('mentor','选择教练') !!}
                                {!! Form::select('mentor',$mentors,$train->mentor->id,['class'=>'form-control js-example-basic-multiple']) !!}
                            </div>
                            @continue
                        @endif
                        @if($head[1]=='intro' )
                            @continue
                        @endif
                        <div class="form-group">
                            {!! Form::label($head[1],$head[0].':') !!}
                            {!! Form::text($head[1],null,['class'=>'form-control']) !!}
                        </div>
                    @endforeach
                </div>
                {{--<div class="tab-pane " id="profile">--}}

                    {{--<div class="form-group">--}}
                        {{--{!! Form::textarea('intro',$train->intro, ['class' => 'ckeditor','id'=>'TextArea1']) !!}--}}
                    {{--</div>--}}
                {{--</div>--}}
            </div>

            <div class="btn-toolbar list-toolbar">
                {!! Form::submit('修改',['class'=>'btn btn-primary ']) !!}
                <a href="/admin/{{$modelurl}}/" data-toggle="modal" class="btn btn-danger">返回</a>
            </div>
            {!! Form::close() !!}
        </div>
    </div>

    {{--<div class="modal small fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">--}}
    {{--<div class="modal-dialog">--}}
    {{--<div class="modal-content">--}}
    {{--<div class="modal-header">--}}
    {{--<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>--}}
    {{--<h3 id="myModalLabel">Delete Confirmation</h3>--}}
    {{--</div>--}}
    {{--<div class="modal-body">--}}

    {{--<p class="error-text"><i class="fa fa-warning modal-icon"></i>Are you sure you want to delete the user?</p>--}}
    {{--</div>--}}
    {{--<div class="modal-footer">--}}
    {{--<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>--}}
    {{--<button class="btn btn-danger" data-dismiss="modal">Delete</button>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--</div>--}}
    <script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
@stop
